<template>
    <f7-page>
        <f7-navbar :title="$t('m.tabs.wealthTitle')">

            <!--<f7-nav-right>
                <f7-link class="txt-button" href="/token-contract-record/">{{$t('m.tabs.wealthRightTitle')}}</f7-link>
            </f7-nav-right>-->
        </f7-navbar>

        <div class="content-padding">
            <!--      <card-one title="ZOL通证合约" :subtitle="`3000.00起 | 今日糖果奖励0.23%起`">-->
            <card-one :title="`零极ZOL${$t('m.tabs.passContract')}`"
                      :subtitle="fromInfo.limit_min?`${$t('m.tabs.fromNum', {num: fromInfo.limit_min})}`:''">
                <f7-button fill color="blue" slot="after" href="/bcdt-buy/">{{$t('m.tabs.subscribeNow')}}</f7-button>
            </card-one>
            <card-one :title="$t('m.tabs.withdraw')">
                <f7-button fill color="blue" slot="after" href="/token-contract-record/?type=recall">
                    {{$t('m.tabs.applyImmediately')}}
                </f7-button>
            </card-one>
            <!--<card-one :title="$t('m.tabs.rule')">
              <f7-button fill color="blue" slot="after" href="/rule/">{{$t('m.tabs.viewNow')}}</f7-button>
            </card-one>-->

            <card-one :title="$t('m.tabs.equitySwap')">
                <f7-button fill color="blue" slot="after" href="/equity-swap/">{{$t('m.tabs.equitySwapNow')}}
                </f7-button>
            </card-one>
            <card-one :title="$t('m.tabs.mall')">
                <f7-button fill color="blue" slot="after" href="/mall-jifen/">查看积分</f7-button>
            </card-one>

            <card-one title="零极生态新手指南">
                <f7-button fill color="blue" slot="after">查看指南</f7-button>
            </card-one>

        </div>
    </f7-page>
</template>

<script>
    import CardOne from '../../ajComponents/card'
    import {getProjectList} from "../../api/wealth";
    import {getToken} from "../../utils/auth";

    export default {
        name: "wealth",
        data() {
            return {
                fromInfo: {}
            }
        },
        watch: {
            '$store.getters.token'(val) {
                if (val) this.init()
            }
        },
        mounted() {
            if (getToken()) this.init();
        },
        methods: {
            init() {
                getProjectList().then(res => {
                    this.fromInfo = res.data[0];
                })
            }
        },
        components: {
            CardOne
        }
    }
</script>

<style scoped lang="scss">
    .content-padding {
        margin-top: $padding;
    }
</style>
